home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
MAC
/
THINKC
/
4_0
/
TIFF_WIN
/
DO_MOUSE.C
< prev
next >
Wrap
C/C++ Source or Header
|
1990-04-10
|
2KB
|
59 lines
#include "my color.h"
void do_mouse_down(the_event) /* This routine is called for every mouse down event */
EventRecord *the_event;
{
CWindowPtr whichWindow;
long grow_window_result;
ControlHandle control;
CGrafPtr the_tiff_picture;
switch (FindWindow(the_event->where,&whichWindow))
{
case inSysWindow:
SystemClick(&the_event,whichWindow);
break;
case inMenuBar:
DoCommand(MenuSelect(&the_event->where));
break;
case inDrag:
DragWindow(whichWindow,the_event->where,&dragRect);
break;
case inContent:
if (whichWindow != (CWindowPtr)FrontWindow())
SelectWindow(whichWindow);
else if(!do_controls(whichWindow, the_event->where))
{
GlobalToLocal(&the_event->where);
extendedCH = ((the_event->modifiers & shiftKey) != 0);
} /*else*/
break;
case inGoAway:
if (TrackGoAway (whichWindow, &the_event->where))
KillWindow (whichWindow);
break;
case inGrow:
grow_window_result = GrowWindow(whichWindow,the_event->where, &screenBits.bounds);
if(grow_window_result)
{
invalidate_controls(whichWindow);
SizeWindow(whichWindow, LoWord(grow_window_result),
HiWord(grow_window_result), TRUE);
the_tiff_picture = (CGrafPtr)(*(CWindowPeek)whichWindow).refCon;
if(the_tiff_picture)
{
(*the_tiff_picture).portRect.bottom = (*the_tiff_picture).portRect.top + (whichWindow->portRect.bottom - whichWindow->portRect.top) - BAR_WIDTH;
(*the_tiff_picture).portRect.right = (*the_tiff_picture).portRect.left + (whichWindow->portRect.right - whichWindow->portRect.left) - BAR_WIDTH;
if( (*the_tiff_picture).portRect.bottom > (**(*the_tiff_picture).portPixMap).bounds.bottom)
(*the_tiff_picture).portRect.bottom = (**(*the_tiff_picture).portPixMap).bounds.bottom;
if( (*the_tiff_picture).portRect.right > (**(*the_tiff_picture).portPixMap).bounds.right)
(*the_tiff_picture).portRect.right = (**(*the_tiff_picture).portPixMap).bounds.right;
}
adjust_scroll_bars(whichWindow);
}
break;
} /*switch FindWindow*/
}